<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>信息通过查询</title>
    <link rel="stylesheet" href="./css/base.css" />
    <link rel="stylesheet" href="./iconfont/iconfont.css" />
    <link rel="stylesheet" href="./css/vant@2.12.54.css" />
    <link rel="stylesheet" href="./css/inquire.css" />
    <style>
      body {
        background: none;
        position: relative;
        overflow: initial;
      }

      .logo {
        position: absolute;
      }

      .box {
        height: auto;
        position: relative;
      }

      .copyright {
        position: fixed;
        background-color: #fff;
        transform: none;
        display: block;
        text-align: center;
        width: 100%;
        transform: none;
        left: 0;
        bottom: 0;
        padding-bottom: 10px;
        padding-bottom: 20px;
      }

      #app {
        width: 100%;
        height: auto;
        min-height: 100vh;
      }

      .danhao {
        width: 95%;
        height: 50px;
        border: 1px solid #888;
        border-radius: 5px;
        margin-top: 35px;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    </style>
  </head>

  <body>
    <div id="app">
      <div class="logo">
        <img src="./img/Logo.png" alt="" />
      </div>
      <img class="banner" src="./img/bg_4.png" />
      <div class="box">
        <div class="sousuo">通过</div>
        <div class="list">
          <div class="line">
            <div class="title">物流快递</div>
            <div class="opt">快递单号</div>
          </div>
          <div
            class="line"
            @click="copyNo(i.express_no,'inpId'+index)"
            v-for="(i,index) in list"
          >
            <div class="title">{{i.express_company}}</div>
            <div class="opt copyBtn">{{i.express_no}}</div>
            <input
              type="text"
              :id="'inpId'+index"
              v-show="false"
              :value="i.express_no"
            />
          </div>
        </div>

        <!-- <p class="f20 fwb">{{expressage}}快递单号</p>
        <div class="danhao">{{couriernumber}}</div> -->
      </div>
      <p class="copyright">德龙农业版权所有</p>
    </div>
  </body>
  <script src="./js/vue@2.7.14.js"></script>
  <script src="./js/axios@1.5.0.min.js"></script>
  <script src="./js/vant@2.12.54.min.js"></script>
  <script src="./js/request.js"></script>
  <script src="https://cdn.staticfile.org/clipboard.js/2.0.4/clipboard.min.js"></script>
  <script>
    new Vue({
      el: "#app",
      data: {
        cardnumber: "",
        expressage: "",
        couriernumber: "",
        list: [],
      },
      mounted() {
        const token = sessionStorage.getItem("token");
        const account = sessionStorage.getItem("account");
        const url = baseUrl + "/user.order/getInfo";
        const urls = baseUrl + "/user.order/getExpressNo";
        if (!token) {
          console.log(111);
          window.location.href = "login.html";
        }
        const urlParams = new URLSearchParams(window.location.search);
        const article_id = urlParams.get("id") || account;
        axios({
          url: urls,
          method: "post",
          params: {
            app_id: 10001,
            token: token,
            account: article_id,
          },
        }).then((res) => {
          // console.log(res);
          // this.expressage = res.data.data[0].express_company;
          // this.couriernumber = res.data.data[0].express_no;
          this.list = res.data.data;
        });
      },
      methods: {
        copyNo(txt, id) {
          new ClipboardJS(".copyBtn", {
            text: function (trigger) {
              return txt;
            },
          })
            .on("success", (e) => {
              this.$toast.success("复制成功！");
            })
            .on("error", (e) => {
              this.$toast.fail("复制失败！");
            });
        },
      },
    });
    Vue.use(vant);
  </script>
</html>
